package HuaWei;


import java.util.Arrays;

public class Main1 {
    public static void main(String[] args) {

    }


    public static int help(int[] arr){
        int n = arr.length;
        int[] maxDP = new int[n];
        int[] minDP = new int[n];
        maxDP[0] = arr[0];
        minDP[0] = arr[0];
        for (int i = 1; i < n; i++) {
            maxDP[i] = Math.max(arr[i],Math.max(arr[i]*maxDP[i-1],arr[i]*minDP[i-1]));
            minDP[i] = Math.min(arr[i],Math.min(arr[i]*maxDP[i-1],arr[i]*minDP[i-1]));
        }
        Arrays.sort(maxDP);
        return maxDP[n-1];
    }

}
